<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
   'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
  <html xmlns='http://www.w3.org/1999/xhtml'>
    <head>
      <meta http-equiv='content-type' content='text/html; charset=utf-8' />
      <meta name='generator' content='CoverStory' />
      <link rel=StyleSheet href='coverstory.css' type='text/css'>
      <script src='coverstory.js' language='javascript' type='text/javascript'></script>
      <title>SBJsonParser.m</title>
    </head>
    <body id='coverstory' onload='coverstory_load()' onunload='coverstory_unload()'>
      <div id='maincontainer'>
        <h1 id='sourcename'>SBJsonParser.m</h1>
        <h2 id='sourcepath'>/Users/ankitthakur/Documents/Sample/XCode Tools/ATNetworks/Classes/JSONDispatcher/JSON/SBJsonParser.m</h2>
        <div id='sourcedate'>15/06/10 6:47 PM</div>
        <div id='filelistcontainer'>
          <div id='filesummary'>35.8% of 1100 lines</div>
          <table id='filetable'>
            <tr id='filelistheader'>
              <th id='filelistheadersource'>Source</th>
              <th id='filelistheaderpercent'>%</th>
            </tr>
            <tr class='fileline'>
<td class='filename'><a href='ATImageDownloader.m.html'>ATImageDownloader.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATImageOperation.m.html'>ATImageOperation.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='GridView.m.html'>GridView.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='IconView.m.html'>IconView.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='NSObject+SBJSON.m.html'>NSObject+SBJSON.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='NSString+SBJSON.m.html'>NSString+SBJSON.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='Reachability.m.html'>Reachability.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='TableViewCell.m.html'>TableViewCell.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='SBJsonWriter.m.html'>SBJsonWriter.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>2.63</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='Music.m.html'>Music.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>7.69</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='SBJSON.m.html'>SBJSON.m</a></td>
<td class='filepercent'><span class='filelessthan35percent'>30.16</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATJSONDispatcher.m.html'>ATJSONDispatcher.m</a></td>
<td class='filepercent'><span class='filelessthan45percent'>35.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='SBJsonParser.m.html'>SBJsonParser.m</a></td>
<td class='filepercent'><span class='filelessthan55percent'>46.36</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATNetworksAppDelegate.m.html'>ATNetworksAppDelegate.m</a></td>
<td class='filepercent'><span class='filelessthan55percent'>50.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='SBJsonBase.m.html'>SBJsonBase.m</a></td>
<td class='filepercent'><span class='filelessthan65percent'>60.87</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATNetwork.m.html'>ATNetwork.m</a></td>
<td class='filepercent'><span class='filelessthan75percent'>69.89</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='main.m.html'>main.m</a></td>
<td class='filepercent'><span class='filelessthan75percent'>71.43</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATIconDownloader.m.html'>ATIconDownloader.m</a></td>
<td class='filepercent'><span class='filelessthan75percent'>72.34</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='TableViewController.m.html'>TableViewController.m</a></td>
<td class='filepercent'><span class='filegoodcoveragepercent'>79.71</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATNetworksViewController.m.html'>ATNetworksViewController.m</a></td>
<td class='filepercent'><span class='filegoodcoveragepercent'>89.36</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATConnection.m.html'>ATConnection.m</a></td>
<td class='filepercent'><span class='filegoodcoveragepercent'>100.00</span></td>
</tr>

          </table>
        </div>
        <div id='sourcecontainer'>
          <div id='sourcesummary'>Executed 46.4% of 220 lines (102 executed, 220 executable, 475 total lines)</div>
          <table id='sourcetable'>
          <tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>/*</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> Copyright (C) 2009 Stig Brautaset. All rights reserved.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> Redistribution and use in source and binary forms, with or without</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> modification, are permitted provided that the following conditions are met:</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> * Redistributions of source code must retain the above copyright notice, this</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>   list of conditions and the following disclaimer.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> * Redistributions in binary form must reproduce the above copyright notice,</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>   this list of conditions and the following disclaimer in the documentation</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>   and/or other materials provided with the distribution.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> * Neither the name of the author nor the names of its contributors may be used</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>   to endorse or promote products derived from this software without specific</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>   prior written permission.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> */</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>#import &quot;SBJsonParser.h&quot;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>@interface SBJsonParser ()</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanValue:(NSObject **)o;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanRestOfArray:(NSMutableArray **)o;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanRestOfDictionary:(NSMutableDictionary **)o;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanRestOfNull:(NSNull **)o;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanRestOfFalse:(NSNumber **)o;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanRestOfTrue:(NSNumber **)o;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanRestOfString:(NSMutableString **)o;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>// Cannot manage without looking at the first digit</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanNumber:(NSNumber **)o;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanHexQuad:(unichar *)x;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanUnicodeChar:(unichar *)x;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanIsAtEnd;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>@end</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>#define skipWhitespace(c) while (isspace(*c)) c++</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>#define skipDigits(c) while (isdigit(*c)) c++</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>@implementation SBJsonParser</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>static char ctrl[0x22];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>+ (void)initialize {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    ctrl[0] = &apos;\&quot;&apos;;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    ctrl[1] = &apos;\\&apos;;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>32</td>
<td class='sourcelinehit'>    for (int i = 1; i &lt; 0x20; i++)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>31</td>
<td class='sourcelinehit'>        ctrl[i+1] = i;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    ctrl[0x21] = 0;    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>/**</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> @deprecated This exists in order to provide fragment support in older APIs in one more version.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> It should be removed in the next major version.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> */</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>- (id)fragmentWithString:(id)repr {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    [self clearErrorTrace];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    if (!repr) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        [self addErrorWithCode:EINPUT description:@&quot;Input was &apos;nil&apos;&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        return nil;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    depth = 0;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    c = [repr UTF8String];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    id o;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    if (![self scanValue:&amp;o]) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        return nil;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // We found some valid JSON. But did it also contain something else?</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    if (![self scanIsAtEnd]) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        [self addErrorWithCode:ETRAILGARBAGE description:@&quot;Garbage after JSON&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        return nil;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    NSAssert1(o, @&quot;Should have a valid object from %@&quot;, repr);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    return o;    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>- (id)objectWithString:(NSString *)repr {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    id o = [self fragmentWithString:repr];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    if (!o)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        return nil;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // Check that the object we&apos;ve found is a valid JSON container.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    if (![o isKindOfClass:[NSDictionary class]] &amp;&amp; ![o isKindOfClass:[NSArray class]]) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        [self addErrorWithCode:EFRAGMENT description:@&quot;Valid fragment, but not JSON&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        return nil;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    return o;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>/*</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> In contrast to the public methods, it is an error to omit the error parameter here.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'> */</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanValue:(NSObject **)o</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>16003</td>
<td class='sourcelinehit'>{</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>16003</td>
<td class='sourcelinehit'>    skipWhitespace(c);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>16003</td>
<td class='sourcelinehit'>    switch (*c++) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        case &apos;{&apos;:</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>501</td>
<td class='sourcelinehit'>            return [self scanRestOfDictionary:(NSMutableDictionary **)o];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            break;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        case &apos;[&apos;:</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>            return [self scanRestOfArray:(NSMutableArray **)o];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            break;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        case &apos;&quot;&apos;:</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>10026</td>
<td class='sourcelinehit'>            return [self scanRestOfString:(NSMutableString **)o];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            break;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        case &apos;f&apos;:</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            return [self scanRestOfFalse:(NSNumber **)o];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            break;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        case &apos;t&apos;:</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            return [self scanRestOfTrue:(NSNumber **)o];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            break;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        case &apos;n&apos;:</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>587</td>
<td class='sourcelinehit'>            return [self scanRestOfNull:(NSNull **)o];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            break;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        case &apos;-&apos;:</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        case &apos;0&apos;...&apos;9&apos;:</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>4888</td>
<td class='sourcelinehit'>            c--; // cannot verify number correctly without the first character</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>4888</td>
<td class='sourcelinehit'>            return [self scanNumber:(NSNumber **)o];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            break;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        case &apos;+&apos;:</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            [self addErrorWithCode:EPARSENUM description: @&quot;Leading + disallowed in number&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            break;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        case 0x0:</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            [self addErrorWithCode:EEOF description:@&quot;Unexpected end of string&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            break;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        default:</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            [self addErrorWithCode:EPARSE description: @&quot;Unrecognised leading character&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            break;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    NSAssert(0, @&quot;Should never get here&quot;);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanRestOfTrue:(NSNumber **)o</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>{</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    if (!strncmp(c, &quot;rue&quot;, 3)) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        c += 3;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        *o = [NSNumber numberWithBool:YES];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        return YES;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    [self addErrorWithCode:EPARSE description:@&quot;Expected &apos;true&apos;&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanRestOfFalse:(NSNumber **)o</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>{</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    if (!strncmp(c, &quot;alse&quot;, 4)) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        c += 4;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        *o = [NSNumber numberWithBool:NO];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        return YES;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    [self addErrorWithCode:EPARSE description: @&quot;Expected &apos;false&apos;&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>587</td>
<td class='sourcelinehit'>- (BOOL)scanRestOfNull:(NSNull **)o {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>587</td>
<td class='sourcelinehit'>    if (!strncmp(c, &quot;ull&quot;, 3)) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>587</td>
<td class='sourcelinehit'>        c += 3;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>587</td>
<td class='sourcelinehit'>        *o = [NSNull null];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>587</td>
<td class='sourcelinehit'>        return YES;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    [self addErrorWithCode:EPARSE description: @&quot;Expected &apos;null&apos;&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>- (BOOL)scanRestOfArray:(NSMutableArray **)o {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    if (maxDepth &amp;&amp; ++depth &gt; maxDepth) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        [self addErrorWithCode:EDEPTH description: @&quot;Nested too deep&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    *o = [NSMutableArray arrayWithCapacity:8];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>502</td>
<td class='sourcelinehit'>    for (; *c ;) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        id v;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>        skipWhitespace(c);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>501</td>
<td class='sourcelinehit'>        if (*c == &apos;]&apos; &amp;&amp; c++) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>            depth--;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>            return YES;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>500</td>
<td class='sourcelinehit'>        if (![self scanValue:&amp;v]) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            [self addErrorWithCode:EPARSE description:@&quot;Expected value while parsing array&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>500</td>
<td class='sourcelinehit'>        [*o addObject:v];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>500</td>
<td class='sourcelinehit'>        skipWhitespace(c);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>500</td>
<td class='sourcelinehit'>        if (*c == &apos;,&apos; &amp;&amp; c++) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>998</td>
<td class='sourcelinehit'>            skipWhitespace(c);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>499</td>
<td class='sourcelinehit'>            if (*c == &apos;]&apos;) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                [self addErrorWithCode:ETRAILCOMMA description: @&quot;Trailing comma disallowed in array&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    [self addErrorWithCode:EEOF description: @&quot;End of input while parsing array&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanRestOfDictionary:(NSMutableDictionary **)o </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>501</td>
<td class='sourcelinehit'>{</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>501</td>
<td class='sourcelinehit'>    if (maxDepth &amp;&amp; ++depth &gt; maxDepth) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        [self addErrorWithCode:EDEPTH description: @&quot;Nested too deep&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>501</td>
<td class='sourcelinehit'>    *o = [NSMutableDictionary dictionaryWithCapacity:7];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>16504</td>
<td class='sourcelinehit'>    for (; *c ;) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        id k, v;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>2</td>
<td class='sourcelinehit'>        skipWhitespace(c);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>16003</td>
<td class='sourcelinehit'>        if (*c == &apos;}&apos; &amp;&amp; c++) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>501</td>
<td class='sourcelinehit'>            depth--;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>501</td>
<td class='sourcelinehit'>            return YES;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>15502</td>
<td class='sourcelinehit'>        if (!(*c == &apos;\&quot;&apos; &amp;&amp; c++ &amp;&amp; [self scanRestOfString:&amp;k])) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            [self addErrorWithCode:EPARSE description: @&quot;Object key string expected&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        skipWhitespace(c);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>15502</td>
<td class='sourcelinehit'>        if (*c != &apos;:&apos;) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            [self addErrorWithCode:EPARSE description: @&quot;Expected &apos;:&apos; separating key and value&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>15502</td>
<td class='sourcelinehit'>        c++;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>15502</td>
<td class='sourcelinehit'>        if (![self scanValue:&amp;v]) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            NSString *string = [NSString stringWithFormat:@&quot;Object value expected for key: %@&quot;, k];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            [self addErrorWithCode:EPARSE description: string];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>15502</td>
<td class='sourcelinehit'>        [*o setObject:v forKey:k];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>15502</td>
<td class='sourcelinehit'>        skipWhitespace(c);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>15502</td>
<td class='sourcelinehit'>        if (*c == &apos;,&apos; &amp;&amp; c++) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>15002</td>
<td class='sourcelinehit'>            skipWhitespace(c);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>15001</td>
<td class='sourcelinehit'>            if (*c == &apos;}&apos;) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                [self addErrorWithCode:ETRAILCOMMA description: @&quot;Trailing comma disallowed in object&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    [self addErrorWithCode:EEOF description: @&quot;End of input while parsing object&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanRestOfString:(NSMutableString **)o </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>25528</td>
<td class='sourcelinehit'>{</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>25528</td>
<td class='sourcelinehit'>    *o = [NSMutableString stringWithCapacity:16];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    do {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        // First see if there&apos;s a portion we can grab in one go. </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        // Doing this caused a massive speedup on the long string.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>25550</td>
<td class='sourcelinehit'>        size_t len = strcspn(c, ctrl);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>25550</td>
<td class='sourcelinehit'>        if (len) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            // check for </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            id t = [[NSString alloc] initWithBytesNoCopy:(char*)c</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                                                  length:len</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                                                encoding:NSUTF8StringEncoding</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>25550</td>
<td class='sourcelinehit'>                                            freeWhenDone:NO];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>25550</td>
<td class='sourcelinehit'>            if (t) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>25550</td>
<td class='sourcelinehit'>                [*o appendString:t];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>25550</td>
<td class='sourcelinehit'>                [t release];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>25550</td>
<td class='sourcelinehit'>                c += len;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>25550</td>
<td class='sourcelinehit'>        if (*c == &apos;&quot;&apos;) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>25528</td>
<td class='sourcelinehit'>            c++;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>25528</td>
<td class='sourcelinehit'>            return YES;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>22</td>
<td class='sourcelinehit'>        } else if (*c == &apos;\\&apos;) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>22</td>
<td class='sourcelinehit'>            unichar uc = *++c;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>22</td>
<td class='sourcelinehit'>            switch (uc) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                case &apos;\\&apos;:</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                case &apos;/&apos;:</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                case &apos;&quot;&apos;:</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                    break;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                case &apos;b&apos;:   uc = &apos;\b&apos;;  break;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                case &apos;n&apos;:   uc = &apos;\n&apos;;  break;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                case &apos;r&apos;:   uc = &apos;\r&apos;;  break;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                case &apos;t&apos;:   uc = &apos;\t&apos;;  break;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                case &apos;f&apos;:   uc = &apos;\f&apos;;  break;                    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                case &apos;u&apos;:</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                    c++;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                    if (![self scanUnicodeChar:&amp;uc]) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                        [self addErrorWithCode:EUNICODE description: @&quot;Broken unicode character&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                        return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                    c--; // hack.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                    break;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                default:</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                    [self addErrorWithCode:EESCAPE description: [NSString stringWithFormat:@&quot;Illegal escape sequence &apos;0x%x&apos;&quot;, uc]];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                    return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                    break;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>22</td>
<td class='sourcelinehit'>            CFStringAppendCharacters((CFMutableStringRef)*o, &amp;uc, 1);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>22</td>
<td class='sourcelinehit'>            c++;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        } else if (*c &lt; 0x20) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            [self addErrorWithCode:ECTRL description: [NSString stringWithFormat:@&quot;Unescaped control character &apos;0x%x&apos;&quot;, *c]];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        } else {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            NSLog(@&quot;should not be able to get here&quot;);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>22</td>
<td class='sourcelinehit'>    } while (*c);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    [self addErrorWithCode:EEOF description:@&quot;Unexpected EOF while parsing string&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanUnicodeChar:(unichar *)x</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>{</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    unichar hi, lo;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    if (![self scanHexQuad:&amp;hi]) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        [self addErrorWithCode:EUNICODE description: @&quot;Missing hex quad&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        return NO;        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    if (hi &gt;= 0xd800) {     // high surrogate char?</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        if (hi &lt; 0xdc00) {  // yes - expect a low char</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            if (!(*c == &apos;\\&apos; &amp;&amp; ++c &amp;&amp; *c == &apos;u&apos; &amp;&amp; ++c &amp;&amp; [self scanHexQuad:&amp;lo])) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                [self addErrorWithCode:EUNICODE description: @&quot;Missing low character in surrogate pair&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            if (lo &lt; 0xdc00 || lo &gt;= 0xdfff) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                [self addErrorWithCode:EUNICODE description:@&quot;Invalid low surrogate char&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            hi = (hi - 0xd800) * 0x400 + (lo - 0xdc00) + 0x10000;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        } else if (hi &lt; 0xe000) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            [self addErrorWithCode:EUNICODE description:@&quot;Invalid high character in surrogate pair&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    *x = hi;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    return YES;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanHexQuad:(unichar *)x</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>{</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    *x = 0;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    for (int i = 0; i &lt; 4; i++) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        unichar uc = *c;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        c++;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        int d = (uc &gt;= &apos;0&apos; &amp;&amp; uc &lt;= &apos;9&apos;)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        ? uc - &apos;0&apos; : (uc &gt;= &apos;a&apos; &amp;&amp; uc &lt;= &apos;f&apos;)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        ? (uc - &apos;a&apos; + 10) : (uc &gt;= &apos;A&apos; &amp;&amp; uc &lt;= &apos;F&apos;)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        ? (uc - &apos;A&apos; + 10) : -1;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        if (d == -1) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            [self addErrorWithCode:EUNICODE description:@&quot;Missing hex digit in quad&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        *x *= 16;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        *x += d;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    return YES;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanNumber:(NSNumber **)o</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>4888</td>
<td class='sourcelinehit'>{</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>4888</td>
<td class='sourcelinehit'>    const char *ns = c;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // The logic to test for validity of the number formatting is relicensed</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // from JSON::XS with permission from its author Marc Lehmann.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // (Available at the CPAN: http://search.cpan.org/dist/JSON-XS/ .)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>4888</td>
<td class='sourcelinehit'>    if (&apos;-&apos; == *c)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>26</td>
<td class='sourcelinehit'>        c++;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>4888</td>
<td class='sourcelinehit'>    if (&apos;0&apos; == *c &amp;&amp; c++) {        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>282</td>
<td class='sourcelinehit'>        if (isdigit(*c)) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            [self addErrorWithCode:EPARSENUM description: @&quot;Leading 0 disallowed in number&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>4606</td>
<td class='sourcelinehit'>    } else if (!isdigit(*c) &amp;&amp; c != ns) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        [self addErrorWithCode:EPARSENUM description: @&quot;No digits after initial minus&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    } else {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>18806</td>
<td class='sourcelinehit'>        skipDigits(c);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // Fractional part</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>4888</td>
<td class='sourcelinehit'>    if (&apos;.&apos; == *c &amp;&amp; c++) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1001</td>
<td class='sourcelinehit'>        if (!isdigit(*c)) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            [self addErrorWithCode:EPARSENUM description: @&quot;No digits after decimal point&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>2001</td>
<td class='sourcelinehit'>        skipDigits(c);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // Exponential part</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>4888</td>
<td class='sourcelinehit'>    if (&apos;e&apos; == *c || &apos;E&apos; == *c) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        c++;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        if (&apos;-&apos; == *c || &apos;+&apos; == *c)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            c++;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        if (!isdigit(*c)) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            [self addErrorWithCode:EPARSENUM description: @&quot;No digits after exponent&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        skipDigits(c);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    id str = [[NSString alloc] initWithBytesNoCopy:(char*)ns</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                                            length:c - ns</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                                          encoding:NSUTF8StringEncoding</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>4888</td>
<td class='sourcelinehit'>                                      freeWhenDone:NO];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>4888</td>
<td class='sourcelinehit'>    [str autorelease];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>4888</td>
<td class='sourcelinehit'>    if (str &amp;&amp; (*o = [NSDecimalNumber decimalNumberWithString:str]))</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>4888</td>
<td class='sourcelinehit'>        return YES;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    [self addErrorWithCode:EPARSENUM description: @&quot;Failed creating decimal instance&quot;];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    return NO;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)scanIsAtEnd</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>{</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    skipWhitespace(c);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    return !*c;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>@end</td>
</tr>

          </table>
        </div>
      </div>
    </body>
  </html>